import type { UserRouter } from '@/api/modules/user/user';
import { LOCALSTORAGE_ENUM } from '@/enum/system';
import type { SizeType } from 'ant-design-vue/es/config-provider';
import { defineStore } from 'pinia';

type PageStore = {
  tabs: UserRouter[];
  theme: 'dark' | 'light';
  showTabs: boolean;
  componentSize: SizeType;
  collapsed: boolean;
};

const usePageStore = defineStore(LOCALSTORAGE_ENUM.PAGE, {
  state: (): PageStore => ({
    tabs: [],
    theme: 'light',
    showTabs: true,
    componentSize: 'middle',
    collapsed: false,
  }),
  persist: true,
});

export default usePageStore;
